package inheritance;
/*
讲的是继承的作用
 */
public class Animal {
    String name;
    int age;

    public void eat(){
        System.out.println(name + "正在吃饭");
    }
    public void sleep(){
        System.out.println(name + "正在睡觉");
    }
}

 class Dog extends Animal{
    public void bark(){
        System.out.println(name + "汪汪叫！~~~");
    }
}


class Cat extends Animal {

    public void mew(){
        System.out.println(name + "喵喵叫~~~");
    }
}

